package behavior.stratege;

import java.util.Scanner;

/**
 * 策略模式测试类
 *
 * @author ykr
 * @date 2022/4/7
 */
public class StrategeTest {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Role role = new Role("张三");
		while (true) {
			if (1 == scanner.nextInt()){
				role.setSkill(new Skill1());
				role.skill();
			}
			if (2 == scanner.nextInt()){
				role.setSkill(new Skill2());
				role.skill();
			}
		}
	}
}
